<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    div{
        width: 300px;
        height: 400px;
        background-color: aquamarine;
    }
</style>
<body>
    <div></div>
    <script>
        let div=document.querySelector('div');
        let flag=true;
        div.onclick=function(){
            if(flag){
                this.style.backgroundColor='yellowgreen';
                this.style.height='200px';
                this.style.width='200px';
            }else{
                this.style.backgroundColor='aquamarine';
                this.style.height='400px';
                this.style.width='300px';
            }
            flag=!flag;
        }
    </script>
</body>
</html>